package test;

import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import com.pur.zsms.common.util.PubFun;
import com.pur.zsms.common.util.pub.FDate;

public class Xiaoshuo {
	public static void main(String[] args) {
		/*
		 * String nowDate00 = "2015-09-29"; FDate fd = new FDate();
		 * 
		 * Date d1 = fd.getDate(nowDate00); System.out.println(d1);
		 */
		Date today;
		Calendar now;
		DateFormat f1;
		String s1;

		System.out.println("\n显示Date类的相关用法");

		today = new Date();
		System.out.println("new Date()= \t" + today);

		System.out.println("\n用DateFormat类显示各种日期格式");

		// 显示各种日期格式
		f1 = DateFormat.getDateInstance();
		s1 = f1.format(today);
		System.out.println("DateFormat.getDateInstance()= \t" + s1);

		f1 = DateFormat.getDateInstance(DateFormat.LONG, Locale.CHINA);
		s1 = f1.format(today);
		System.out.println("DateFormat.getDateInstance(DateFormat.LONG,Locale.CHINA)= \t" + s1);

		f1 = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.CHINA);
		s1 = f1.format(today);
		System.out.println("DateFormat.getDateInstance(DateFormat.MEDIUM,Locale.CHINA)= \t" + s1);

		f1 = DateFormat.getDateInstance(DateFormat.SHORT, Locale.CHINA);
		s1 = f1.format(today);
		System.out.println("DateFormat.getDateInstance(DateFormat.SHORT,Locale.CHINA)= \t" + s1);

		System.out.println("\n用DateFormat类显示各种时间格式");

		// 显示各种时间格式
		f1 = DateFormat.getTimeInstance();
		s1 = f1.format(today);
		System.out.println("DateFormat.getTimeInstance()= \t" + s1);

		f1 = DateFormat.getTimeInstance(DateFormat.LONG, Locale.CHINA);
		s1 = f1.format(today);
		System.out.println("DateFormat.getTimeInstance(DateFormat.LONG,Locale.CHINA)= \t" + s1);

		f1 = DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.CHINA);
		s1 = f1.format(today);
		System.out.println("DateFormat.getTimeInstance(DateFormat.MEDIUM,Locale.CHINA)= \t" + s1);

		f1 = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.CHINA);
		s1 = f1.format(today);
		System.out.println("DateFormat.getTimeInstance(DateFormat.SHORT,Locale.CHINA)= \t" + s1);

		System.out.println("\n显示Calendar的相关时间用法");

		now = Calendar.getInstance();
		today = now.getTime();
		System.out.println("Calendar.getInstance().getTime()= \t" + today.toString());

	}
	/***
	 * 
	 * 
	 * **/
}
